package sz.szsmk.citizencard.widget

import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.text.TextPaint
import android.text.style.ClickableSpan
import android.util.Log
import android.view.View
import sz.szsmk.citizencard.util.Constant
import sz.szsmk.citizencard.util.JumpUtils

public class NoLineClickSpan(var color: String, url: String, context: Context) : ClickableSpan() {
    var context: Context = context;
    override fun updateDrawState(ds: TextPaint) {
        //设置字体颜色
        ds.color = (Color.parseColor(color))
        ds.isUnderlineText = false //去掉下划线
    }

    override fun onClick(widget: View) {
        //点击超链接时调用
        Log.d("MainActiviy", "您点击了协议")
        val url = Constant.BASE_URL + "app-front-end/#/common/agreementHuiminWallet"
        val bundle = Bundle()
        bundle.putString("url", url)
        JumpUtils.jumptoNatvie(context, "webView", 0, bundle)
    }
}